package org.ysu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.ysu.common.JsonResult;
import org.ysu.mapper.VCadreMapper;
import org.ysu.service.VCadreService;
import org.ysu.service.VerifierService;

@RestController
@RequestMapping("/vcadre")
public class VCadreController {
    @Autowired
    VCadreService vCadreService;

    /**
     * 将family表中的vc_id=vcid1的行的vc_id改为vcid2
     * @param vcid1
     * @param vcid2
     * @return
     */
    @PostMapping("/changemaster/{vcid1}/{vcid2}")
    public JsonResult changeMaster(@PathVariable Integer vcid1, @PathVariable Integer vcid2){
        Integer hang =vCadreService.changeMaster(vcid1,vcid2);
        JsonResult jsonResult =new JsonResult(1,"success",hang);
        return jsonResult;
    }
}
